package com.company.netease2021;

import java.util.Scanner;

public class Main3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] relation = new int[n - 1];
        for (int i = 0; i < n - 1; i++) {
            relation[i] = sc.nextInt();
        }
        int[][] matrix = new int[n][n];
        for (int i = 0; i < n - 1; i++) {
            int pre = i + 1;
            int cur = relation[i];
            matrix[pre][cur] = 1;

        }
        for (int i = 1; i < n; i++) {
            if(matrix[0][i] == 1){
                
            }
        }


    }


}
